package com.fognl.core.net.handler;

import java.io.PrintStream;

/** Default ResponseListener implementation, for testing */
public class DefaultResponseListener implements ResponseListener
{
	private PrintStream out;
	
	public DefaultResponseListener(PrintStream out)
	{
		super();
		this.out = out;
	}
	
	public void onDataReceived(Request request, Object data)
	{
		out.println("onDataReceived(): data=" + data);
	}

	public void onRequestCancel(Request request)
	{
		out.println("onRequestCancel(): request=" + request);
	}

	public void onRequestComplete(Request request, Response response)
	{
		out.println("onRequestComplete(): request=" + request + " response=" + response);
	}

	public void onRequestException(Request request, Throwable cause)
	{
		out.println("onRequestException(): request=" + request + ", cause=" + cause);
	}

	public void onRequestTimeout(Request request)
	{
		out.println("onRequestTimeout(): request=" + request);
	}
}
